import static java.lang.Thread.sleep;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-03-30
 * Time: 12:56
 */
public class test_5 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            while (true) {
                try {
                    sleep(1000);
                    System.out.println("使用 lambda 表达式");
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        t.start();
        while (true) {
            sleep(1000);
            System.out.println("main主线程");

        }
    }


}
